package com.example.rpmanagementsb.service.impl;


import com.example.rpmanagementsb.mapper.ReturnPersonMapper;
import com.example.rpmanagementsb.pojo.ReturnPerson;
import com.example.rpmanagementsb.service.ReturnPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ReturnPersonServiceImpl implements ReturnPersonService {
    @Autowired
    private ReturnPersonMapper returnPersonMapper;


    @Override
    public List<ReturnPerson> getPaging(String returnPerson, Integer pageNo, Integer pageSize) {

        //计算起始索引
        Integer startIndex=(pageNo-1)*pageSize;

        return returnPersonMapper.getPaging(returnPerson,startIndex,pageSize);
    }

    @Override
    public Integer getAdd(ReturnPerson returnPerson) {
        return returnPersonMapper.getAdd(returnPerson);
    }

    @Override
    public ReturnPerson getById(Integer id) {
        return returnPersonMapper.getById(id);
    }

    @Override
    public Integer update(ReturnPerson returnPerson) {
        return returnPersonMapper.update(returnPerson);
    }

    @Override
    public Integer getCount(String returnPerson) {
        return returnPersonMapper.getCount(returnPerson);
    }

    @Override
    public Integer delete(Integer id) {
        return returnPersonMapper.delete(id);
    }
}
